package com.etoak.service.impl;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.etoak.entity.Appointment;
import com.etoak.mapper.AppointmentMapper;
import com.etoak.service.AppointmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.stereotype.Service;

@Service
public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appointment> implements AppointmentService {

    @Autowired
    ScheduleServiceImpl scheduleService;
    @Override
    public void add(Appointment appointment) {
        appointment.setCreateTime(DateUtil.now());
        appointment.setStatus(1);
        scheduleService.subSchedule(appointment.getScheduleId());
        this.save(appointment);
    }
}
